package com.xhh.hybriddemo.ui.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.xhh.hybriddemo.R;

import butterknife.ButterKnife;

/**
 * 首页RecyclerView的Adapter
 * Created by haoji on 2017/12/26.
 */

public class HomeAdapter extends RecyclerView.Adapter {
    private Context mContext;
    public HomeAdapter(Context context){
        mContext = context;
    }
    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(mContext).inflate(R.layout.item_home_view,null);
        return new HomeViewHolder(view);
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        if (holder instanceof HomeViewHolder){

        }
    }

    @Override
    public int getItemCount() {
        return 1;
    }

    class HomeViewHolder extends RecyclerView.ViewHolder{

        public HomeViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this,itemView);
        }


    }
}
